package com.boot.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.boot.entity.Girl;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created  on 2018/7/5 10:45.
 * 作者: Dengjb
 * 说明:
 */
@Mapper
public  interface GirlMapper  extends BaseMapper<Girl> {

		/***
		*
		* @Description: 查询列表
		* @Param: [name]
		* @return: com.boot.entity.Girl
		* @Author: dengjb
		* @Date: 2018/7/5
		*/
		@Select("select *from girl ")
		List<Girl> girlList();

	/***
	 *
	 * @Description: 查询
	 * @Param: [name]
	 * @return: com.boot.entity.Girl
	 * @Author: dengjb
	 * @Date: 2018/7/5
	 */
	@Select("select *from girl where name=#{name}")
	Girl findByName(@Param("name") String name);

	/**
		*
		* @Description: 插入
		* @Param: [age, name]
		* @return: void
		* @Author: dengjb
		* @Date: 2018/7/5
		*/
		@Insert("insert into girl (age,name) values (#{age}, #{name} )")
		void insert(@Param("age") String age,@Param("name")  String name);
		/**
		*
		* @Description: 改
		* @Param: [girl]
		* @return: int
		* @Author: dengjb
		* @Date: 2018/7/5
		*/
		@Update("update girl set age = #{age},name =  #{name} where id =#{id}")
		int update  (Girl girl);
		/** 
		*
		* @Description: 删
		* @Param: [girl] 
		* @return: int 
		* @Author: dengjb
		* @Date: 2018/7/5 
		*/ 
		@Delete("delete  from girl  where id =#{id}")
		int delete  (Girl girl);


		Girl selectByPrimaryKey(Integer id);
			//分页
		List<Girl> selectGirlList(Pagination page);
}
